﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using MongoDB.Bson;

namespace NetCoreQrCoreDemo.Models
{
    [Serializable]
    [Attribute.Mongo("MyArticle")]
    public class MyArticle
    {
        public ObjectId _id { get; set; }
        /// <summary>
        /// 文章名称
        /// </summary>
        [Display(Name = "文章名称")]
        public string title { get; set; }
        /// <summary>
        /// 文章内容
        /// </summary>
        [Display(Name = "文章内容")]
        public string content { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public string date { get; set; } = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}";
        /// <summary>
        /// 更新时间
        /// </summary>
        [Display(Name = "更新时间")]
        public string updatetime { get; set; }
        /// <summary>
        /// 是否新增
        /// </summary>
        [Display(Name = "是否新增")]
        public bool status { get; set; } =true;
    }
}
